package com.recon.template.controller;


import com.recon.core.vo.OptResult;
import com.recon.template.entity.BaseDict;
import com.recon.template.service.IBaseDictService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 字典表 前端控制器
 * </p>
 *
 * @author yi.zhang
 * @since 2018-07-24
 */
@RestController
@RequestMapping("/template/baseDict")
public class BaseDictCtrl {

    @Autowired
    private IBaseDictService baseDictService;

    @ApiOperation(value = "获取所有字典", notes = "获取所有字典(在字典列表使用)", response = BaseDict.class, responseContainer = "Map")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户id", paramType = "query", dataType = "String", required = true)
    })
    @GetMapping(value = "/getAll")
    public OptResult quarterList(String userId) {
        OptResult optResult= new OptResult();
        List<BaseDict> dictList = baseDictService.selectList(null);
        optResult.setBody(dictList);
        return optResult;
    }

}

